<?php
/**
 * Created by IntelliJ IDEA.
 * User: Administrator
 * Date: 2018/12/18
 * Time: 23:17
 */

namespace app\magic\controller\admin;


use app\magic\service\admin\AdminService;
use app\magic\service\admin\SystemService;

class Admin extends Base
{
    private $adminService=null;
    private $systemService=null;
    private $data=null;
    /**
     * Admin constructor.
     */
    public function __construct()
    {
        //初始化adminService
        $this->adminService = new AdminService();
        $this->systemService = new SystemService();
        parent::__construct();
    }

    /**
     * 用户首页
     */
    public function index(){
//        $res=$this->systemService->backups();
//        if($res>0){
//            $resdata=$this->systemService->beifenList();
//            dump($resdata[0]['name']);
//        }else{
//            echo "error";
//        }
        dump($this->systemService->do_red("beijing_20181219_060507.sql"));
        exit;
        return $this->fetch();
    }
    public function indexData(){
        $search=input('get.');
        unset($search['/admin/user/indexdata']);
        if($search){
            $this->data=$search;
        }
        $list =$this->adminService->selectService();
        $num =$this->adminService->numService();
        dtRequest($search['draw'],$list,$num,$num);
    }
    /**
     *编辑添加修改
     */
    public function edit(){

    }
}